package com.colin.controller;

import com.colin.pojo.ItemCat;
import com.colin.service.ItemCatService;
import com.colin.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author :Colin
 * @version 创建时间: 2021/8/12 16:23
 */
@RestController
@CrossOrigin
@RequestMapping("/itemCat")
public class ItemCatController {
    @Autowired
    private ItemCatService itemCatService;
    /* 查询3级商品分类信息
    请求路径: /itemCat/findItemCatList/{level}
    请求类型: get
    请求参数: level*/
    @GetMapping("/findItemCatList/{level}")
    public SysResult findItemCatList(@PathVariable Integer level){
        List<ItemCat> itemCatList = itemCatService.findItemCatList(level);
        return SysResult.success(itemCatList);
    }
}
